package com.allenkerr.web;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 小柯
 * @date 2017/12/20
 */
@RestController
@RequestMapping("/user")
public class UserController {

  private static final Logger logger = LoggerFactory.getLogger(UserController.class);

  @GetMapping(value = "/one")
  @Cacheable("user-cache")
  public String calculateResult() {
    logger.info("cache test one.");
    return "result";
  }

}
